File tree 1 file changed +5
-3
lines changed
packages/vite/src/node/plugins 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -148,9 +148,11 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
148
148
return {
149
149
name : chunk . fileName ,
150
150
group : 'JS' ,
151
- size : chunk . code . length ,
151
+ size : Buffer . byteLength ( chunk . code ) ,
152
152
compressedSize : await getCompressedSize ( chunk . code ) ,
153
- mapSize : chunk . map ? chunk . map . toString ( ) . length : null ,
153
+ mapSize : chunk . map
154
+ ? Buffer . byteLength ( chunk . map . toString ( ) )
155
+ : null ,
154
156
}
155
157
} else {
156
158
if ( chunk . fileName . endsWith ( '.map' ) ) return null
@@ -160,7 +162,7 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
160
162
return {
161
163
name : chunk . fileName ,
162
164
group : isCSS ? 'CSS' : 'Assets' ,
163
- size : chunk . source . length ,
165
+ size : Buffer . byteLength ( chunk . source ) ,
164
166
mapSize : null , // Rollup doesn't support CSS maps?
165
167
compressedSize : isCompressible
166
168
? await getCompressedSize ( chunk . source )
You can’t perform that action at this time.
0 commit comments